<template>
  <div class="app-container">
    <el-menu
      :default-active="2"
      class="el-menu-demo"
      mode="horizontal"
      :default-openeds="defaultOpeneds"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
      @select="handleSelect"
    >
      <el-menu-item index="1">处理中心</el-menu-item>
      <el-submenu index="2">
        <template slot="title">我的工作台</template>
        <el-menu-item index="2-1">选项1</el-menu-item>
        <el-menu-item index="2-2">选项2</el-menu-item>
        <el-menu-item index="2-3">选项3</el-menu-item>
      </el-submenu>
      <el-menu-item index="3" disabled>消息中心</el-menu-item>
      <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
    </el-menu>
    <div>

      <bottom-menu />
    </div>
  </div>
</template>
<script>
import bottomMenu from '@/components/bottom-menu/bottom-menu.vue'

import { wxmenu } from '@/api/common'
import { notifySuccess, notifyError } from '@/utils/message'
export default {
  name: 'WxMenu',
  components: {
    bottomMenu
  },
  data() {
    return {
      activeIndex2: '2',
      defaultOpeneds: [1],
      menu: [{ 'type': 'view', 'name': '跳转2', 'url': 'http:\/\/www.soso.com\/' }, { 'type': 'view', 'name': '跳转1', 'url': 'http:\/\/www.baidu.com\/' }, { 'type': 'view', 'name': '跳转3', 'url': 'http:\/\/www.baidu.com\/' }]
    }
  }, methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    saveSync() {
      this.menu
      wxmenu(this.wxmenu).then(res => {
        notifySuccess(res.msg)
      }).catch(err => {
        notifyError(err.msg)
      })
    }
  }
}
</script>
<style script>
.content {
	text-align: center;
	height: 400px;
	margin-top: 200px;
}
</style>
